/*
2021-8-8
https://www.acwing.com/problem/content/3800/
*/ 
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
const int N=2e5+5,M=N*2;
int h[N],e[M],ne[M],idx;
int dist1[N],dist2[N];
int n,m,k;
int q[N],p[N];

void add(int a,int b)
{
    e[idx]=b,ne[idx]=h[a],h[a]=idx++;
}

void bfs(int start,int dist[])
{
    memset(dist,0x3f,4*N);
    int hh=0,tt=0;
    dist[start]=0;
    q[0]=start;
    
    while(hh<=tt)
    {
        int t=q[hh++];
        
        for(int i=h[t];~i;i=ne[i])
        {
            int j=e[i];
            if(dist[j]>dist[t]+1)
            {
                dist[j]=dist[t]+1;
                q[++tt]=j;
            }
        }
        
    }
    
}

bool cmp(int a,int b)
{
    return dist1[a]-dist2[a]<dist1[b]-dist2[b];
}

int main()
{
    cin>>n>>m>>k;
    memset(h,-1,sizeof h);
    for(int i=0;i<k;i++) cin>>p[i];
    
    while(m--)
    {
        int a,b;
        cin>>a>>b;
        add(a,b),add(b,a);
    }
    
    bfs(1,dist1);
    bfs(n,dist2);
    
    sort(p,p+k,cmp);
    
    int res=0,front=dist1[p[0]];
    
    for(int i=1;i<k;i++)
    {
        int t=p[i];
        res=max(res,dist2[t]+front+1);
        front=max(front,dist1[t]);
    }
    
    cout<<min(res,dist1[n])<<endl;
    
    return 0;
}



